import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        int random = (int) (Math.random() * 100);
        int guess;
        int min=0;
        int max=100;
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入猜测的数字：");
            guess = sc.nextInt();
            if (guess > random) {
                System.out.println("猜的数字太大了！");
                max = guess;
            } else if (guess < random) {
                System.out.println("猜的数字太小了！");
                min = guess;
            } else {
                System.out.println("恭喜你，猜对了！");
                break;
            }
        }
    }
}
